package com.rt.system.service.impl;

import java.util.List;
import com.rt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rt.system.mapper.RtOptionsInfoMapper;
import com.rt.system.domain.RtOptionsInfo;
import com.rt.system.service.IRtOptionsInfoService;

/**
 * 试题选项Service业务层处理
 * 
 * @author Yg
 * @date 2022-04-13
 */
@Service
public class RtOptionsInfoServiceImpl implements IRtOptionsInfoService 
{
    @Autowired
    private RtOptionsInfoMapper rtOptionsInfoMapper;

    /**
     * 查询试题选项
     * 
     * @param id 试题选项主键
     * @return 试题选项
     */
    @Override
    public RtOptionsInfo selectRtOptionsInfoById(Long id)
    {
        return rtOptionsInfoMapper.selectRtOptionsInfoById(id);
    }

    /**
     * 查询试题选项列表
     * 
     * @param rtOptionsInfo 试题选项
     * @return 试题选项
     */
    @Override
    public List<RtOptionsInfo> selectRtOptionsInfoList(RtOptionsInfo rtOptionsInfo)
    {
        return rtOptionsInfoMapper.selectRtOptionsInfoList(rtOptionsInfo);
    }

    /**
     * 新增试题选项
     * 
     * @param rtOptionsInfo 试题选项
     * @return 结果
     */
    @Override
    public int insertRtOptionsInfo(RtOptionsInfo rtOptionsInfo)
    {
        rtOptionsInfo.setCreateTime(DateUtils.getNowDate());
        return rtOptionsInfoMapper.insertRtOptionsInfo(rtOptionsInfo);
    }

    /**
     * 修改试题选项
     * 
     * @param rtOptionsInfo 试题选项
     * @return 结果
     */
    @Override
    public int updateRtOptionsInfo(RtOptionsInfo rtOptionsInfo)
    {
        rtOptionsInfo.setUpdateTime(DateUtils.getNowDate());
        return rtOptionsInfoMapper.updateRtOptionsInfo(rtOptionsInfo);
    }

    /**
     * 批量删除试题选项
     * 
     * @param ids 需要删除的试题选项主键
     * @return 结果
     */
    @Override
    public int deleteRtOptionsInfoByIds(Long[] ids)
    {
        return rtOptionsInfoMapper.deleteRtOptionsInfoByIds(ids);
    }

    /**
     * 删除试题选项信息
     * 
     * @param id 试题选项主键
     * @return 结果
     */
    @Override
    public int deleteRtOptionsInfoById(Long id)
    {
        return rtOptionsInfoMapper.deleteRtOptionsInfoById(id);
    }
}
